package com.zk.algo;

import java.util.*;

/**
 * 求数列的和
 *
 * (1) System.out.printf("%.2f\n", doubleM);
 * (2) double doubleM = m * 1.0;
 * (3) 忘记加 double 类型声明
 * (4) double result; ===> variable result might not have been initialized
 */
public class QiuShuLieDeHe {

    public static void main(String...args) {

        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();
        int m = scanner.nextInt();

        double result = .0;
        double doubleN = n * 1.0;

        while (m-- > 0) {
            result += doubleN;
            doubleN = Math.sqrt(doubleN);
        }

        System.out.printf("%.2f\n", result);
    }

}
